<template>
<v-container>
  <v-data-table
    :headers="headers"
    :items="items"
    :items-per-page="10"
    class="elevation-1"
  ></v-data-table>
</v-container>
</template>

<script>
export default {
     data: () => ({
         headers:[ {
            text: 'UID',
            align: 'left',
            sortable: false,
            value: 'uid',
          },
          { text: '名称', value: 'name' },
          { text: '密码', value: 'passwd' },
          { text: '类型', value: 'type' },
          { text: '性别', value: 'sex' },
          { text: '生日', value: 'birth' },
          { text: '头像', value: 'img' },
          { text: '签名', value: 'text' },
          { text: '邮箱', value: 'email' },
          { text: '余额', value: 'cridit' },
          ],
          
         items:[],
            tablename:"userinfo",
            limit:999999,
            page:1,
     }),
     methods:{
         inittables(tablename){
             var params = new URLSearchParams();
      params.append("limit", this.limit);
      params.append("page", this.page);
      this.$axios({
        method: "post",
        url: "http://47.100.137.177:8080/YimooBP1.0/mygetall!userinfo",
        data: params
      })
        .then(response => {
          this.items = JSON.parse(response.data);
          //this.headers = JSON.parse()
          console.log(this.items);
        })
        .catch(function(error) {
          console.log(error);
        });
         },
         init(){
             this.inittables(this.tablename);
         }
     },
     created(){
         this.init();
     }
}
</script>

<style>

</style>